#ifndef NETWORKMANAGER_H
#define NETWORKMANAGER_H

#include <QObject>
#include "client.h"
class NetworkManager : public QObject
{
    Q_OBJECT
public:
    explicit NetworkManager(QObject *parent = 0);
    static QString getIp();
signals:
        void recieveData(QString ip,QByteArray data);
        void notify(QString ip,int code);

        // server signals
        void recieveServerData(QByteArray data);
        void serverNotify(int code);
public slots:
        void onSendData(QString ip,QByteArray data);// send the data to the connection specified by ip

        // server slots
        void onSendServerData(QByteArray data);


          //the connection specified by ip
        void onNotify(QString ip,int code);
        void onRecieveData(QString ip,QByteArray data);
private:
      Client *client;

};

#endif // NETWORKMANAGER_H
